Import("utils.js")
Import("ggUtils.js")


// new floatUI().closeAll()
// new floatUI().hideSystemFloat()

Import("utils_fui.js")

new floatUI().setSystemPosition(screen.getScreenWidth(), screen.percentToHeight(0.2));
// SystemPrint.log(isRunAppTask('taskksjs', '活跃'))
// var isOtg = hui.getCheck('check_07ec64ab').getValue()
// var isHideClick = hui.getCheck('check_645ca066').getValue()
// sleep.second(60)
// var GAME_TIME = parseInt(hui.getInput("input_402a3ce6").getValue())

var is_gj_gg = false
// hid.setPowerOff()
// isEnableSwitch('blue_mode')
isBlueMode()
hui.close()
// var ENABLE_MORE_SLEEP_TIME_更多的睡眠 = true
// // agent.shell('dumpsys battery set status 1'); agent.shell('dumpsys battery set level 82'); agent.shell('dumpsys battery set usb 0')
// // agent.shell('dumpsys battery set status 1'); agent.shell('dumpsys battery set level 11'); agent.shell('dumpsys battery set usb 0')
// agent.shell('dumpsys battery set usb 0')
var ENABLE_MORE_SLEEP_TIME_更多的睡眠 = false
// 
// logWindow.close()
// Sleep.time("03:21:20");
// hid.keyPress(0,0x07); //亮屏
// hid.keyPress(0,0x66) //息屏
// click(0.38, 0.5)
// agentOrHidback()
// agentOrHidHome()
// agentOrHidClickOffectY
// hid.back() hid.home()
// click(405,591)
// ocrTextTrue()
// app.closeApp("com.kuaishou.nebula");
// SystemPrint.log(app.getPackName())
// SystemPrint.log(uiSwitch.findByID(控件ID = 'ppx_bsj').getOn())
log('脚本启动中请稍等...')

file.delete('/sdcard/aiworklog.txt')
if (!hasForverExcuteFunc('init' + getDayOfYear()) || isBetweenTime(0, 9)) {
    txt.writeTxt('/sdcard/aiworklog.txt', '清除前一天的数据' + '\n', true)
    log('清除前一天的数据')
    // 新的一天
    SystemPrint.log('新的一天初始化数据, 清除所有缓存数据')
    clearData()
    setForverExcuteFunc('init' + getDayOfYear())
}

if (!agent.isOpen()) {
    log('启用HID模式')
    SystemPrint.log('启用HID 模式' + hid.isOn())
} else {

    // hid.s()
    log('启用agent模式')
    agent.start()
    seting.setAgentScreenShotModel(true)
    agent.shell('dumpsys battery set status 1')
}

log('当前屏蔽应用' + SKIPAPPS)

close多余的弹窗()
if (isBetweenTime(4, 19)) {
    lower降低屏幕亮度()
}
log('关闭所有应用')
stopAllApp()

hideLogWindow()
